/*
 * Created on Sun Sep 24 2017
 * @flow
 * Copyright (c) 2017 jianglinjie
 */
'use strict';

import type { ResBody } from '../types/ResBody';

export function createSucceedBody(msg: string, data: any): ResBody {
  let body = {};
  body.succeed = true;
  body.errorCode = '';
  body.msg = msg;
  body.data = data;

  return body;
}

export function createErrorBody(errorCode: string, msg: string): ResBody {
  let body = {};
  body.succeed = false;
  body.errorCode = errorCode;
  body.msg = msg;
  body.data = null;

  return body;
}